<template>
  <div id="app">
    <ul>
      <li v-for="item in arr" :key="item">{{ item }}</li>
    </ul>
    <button @click="btn">聊一聊</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ["靓女", "靓仔", "程序员"],
    };
  },
  methods: {
    btn() {
      //头部数据加入到最后
      this.arr.push(this.arr[0]);
      //把头部数据删除
      this.arr.shift();
    },
  },
};
</script>
